package com.wq.gof.designer.chain.pointer;

/**
 * @Author: wangqiang20995
 * @Date:2019/1/25
 * @Description:处理低频率的事件
 * @Resource:
 */
public class LowFrequencyEventHandler extends AbstractPointerEventHandler {


    private static final Integer LOW_FREQUENCY = 100;

    @Override
    public void doHandler(String name, Integer level) {
        if (level.intValue() > LOW_FREQUENCY) {
            getNextHandler().doHandler(name, level);
            return;
        }

        System.out.println("低频率handler处理[" + name + "]的请求[" + level + "]");
        return;
    }

    @Override
    public long frequency() {
        return LOW_FREQUENCY;
    }
}
